<template>
	<view class="ys">
		<view class="goodslist">
			<view :class="styleType =='col'?'item':'item row' " v-for="(item,index) in list" :key="index">
				<y-goodsitem :styleType="styleType" v-on="$listeners" :item="item"
					:collectField="collectField"></y-goodsitem>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		props: {
			collectField: {
				typeof: String,
				default: 'id'
			},
			list: {
				typeof: Array,
				default () {
					return [];
				}
			},
			styleType: {
				typeof: String,
				default () {
					return 'col';
				}
			}
		},
		created() {},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	.goodslist {
		display: flex;
		flex-wrap: wrap;
		width: 100%;
		padding: 0 10px;
		box-sizing: border-box;
	}

	.item {
		width: 25%;

		&.row {
			width: 100%;
			display: flex;
		}
	}

	@media (max-width:1000px) {
		.item {
			width: 50%;
		}
	}
</style>